package com.lr.Service.impl;

import com.lr.Service.INetservice;
import com.lr.dao.internet.internetDao_list;
import com.lr.domain.INetSaler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("INetService")
public class INetserviceimpl implements INetservice {
    @Autowired
    internetDao_list internetDao_list;

    public void add(int number, String INet_name, String password, String mg_name, String tele_number)
    {
        INetSaler iNetSaler=new INetSaler();
        iNetSaler.setNumber(number);
        iNetSaler.setINet_name(INet_name);
        iNetSaler.setPassword(password);
        iNetSaler.setMg_name(mg_name);
        iNetSaler.setTele_number(tele_number);
        internetDao_list.add_info(iNetSaler);
    }

    public void delet(int id) {
        internetDao_list.delet_info(id);
    }

    public void change_info(int id, int number, String INet_name, String password, String mg_name, String tele_number) {
        INetSaler iNetSaler=new INetSaler();
        iNetSaler.setNumber(number);
        iNetSaler.setINet_name(INet_name);
        iNetSaler.setPassword(password);
        iNetSaler.setMg_name(mg_name);
        iNetSaler.setTele_number(tele_number);
        internetDao_list.change_info(id,iNetSaler);

    }

    public List<INetSaler> find_all() {
        return internetDao_list.find_all();
    }


}
